﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using netDxf;
using netDxf.Blocks;
using netDxf.Collections;
using netDxf.Entities;
using netDxf.Header;
using netDxf.Objects;
using netDxf.Tables;
using netDxf.Units;
using Attribute = netDxf.Entities.Attribute;
using Image = netDxf.Entities.Image;
using Point = netDxf.Entities.Point;
using Trace = netDxf.Entities.Trace;
using System.Threading;

namespace TestDxfDocument
{
    class Indexable_A_type_tool_holder
    {
        public static void A_type(Dictionary<string, Object> data)
        {
            DxfDocument dxf = new DxfDocument();
            //图层
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            Layer dimensioning = new Layer("dimensioning");    //尺寸层
            Layer refin = new Layer("refin") { Color = AciColor.Red };    //基准线/内轮廓
            Layer centre = new Layer("centre") { Color = AciColor.Yellow };    //中性线
            Layer textlayer = new Layer("textlayer") { Color = AciColor.Blue };    //文本层
            Layer hatching = new Layer("hatching") { Color = AciColor.Blue };    //填充层
            Layer additionalline = new Layer("additionalline") { Color = AciColor.Cyan };    //附加线
            Layer cutting = new Layer("cutting") { Color = AciColor.Red };    //切削层
            Layer nocutting = new Layer("nocutting");    //非切削层
            Layer skcontour = new Layer("skcontour") { Color = AciColor.Cyan };    //sk轮廓层
            Layer skdimensioning = new Layer("skdimensioning");    //sk尺寸线层
            Layer skrefin = new Layer("skrefin") { Color = AciColor.Red };    //sk基准线/内轮廓
            Layer sktext = new Layer("sktext") { Color = AciColor.Blue };  //sk文本
            Layer skhatching = new Layer("skhatching") { Color = AciColor.Blue };    //sk填充
            Layer skadditionlline = new Layer("skadditionlline") { Color = AciColor.Cyan };    //sk附加线
            Layer skviewcontour = new Layer("skviewcontour") { Color = AciColor.Cyan };    //skview轮廓
            Layer skviewdimensioning = new Layer("skviewdimensioning");    //skview尺寸线层

            //基本参数-----------------------------------------------------------------------------------------------------
            double scale = 1; //放大系数
            double pi = Math.PI;
            string path = Convert.ToString(data["path"]);
            double type = Convert.ToDouble(data["type"])/*"L型菱形"*/;
            //double type = 28;

            //定义参数
            double h1 = Convert.ToDouble(data["h1"]) * scale;
            double l4 = Convert.ToDouble(data["l4"]) * scale;
            double b = Convert.ToDouble(data["b"]) * scale;
            double d1 = Convert.ToDouble(data["d1"]) * scale;
            double d2 = Convert.ToDouble(data["d2"]) * scale;
            double f = Convert.ToDouble(data["f"]) * scale;
            double h2 = Convert.ToDouble(data["h2"]) * scale;
            double l1 = Convert.ToDouble(data["l1"]) * scale;
            double l2 = Convert.ToDouble(data["l2"]) * scale;
            double l3 = Convert.ToDouble(data["l3"]) * scale;
            double t = Convert.ToDouble(data["t"]) * scale;
            double e = Convert.ToDouble(data["e"]) * scale;

            /*double h1 = 6 * scale;
            double l4 = 5.6 * scale;
            double b = 6 * scale;
            double d1 = 20 * scale;
            double d2 = 4 * scale;
            double f = 12 * scale;
            double h2 = 8 * scale;
            double l1 = 25 * scale;
            double l2 = 16 * scale;
            double l3 = 4.5 * scale;
            double t = 3.5 * scale;
            double e = 12 * scale;*/

            /*double h1 = 25 * scale;
            double l4 = 27.5 * scale;
            double b = 25 * scale;
            double d1 = 100 * scale;
            double d2 = 11 * scale;
            double f = 38 * scale;
            double h2 = 30 * scale;
            double l1 = 100 * scale;
            double l2 = 59 * scale;
            double l3 = 10 * scale;
            double e = 32 * scale;
            double t;*/
            double L = Convert.ToDouble(data["l"]) * scale;
            double h = Convert.ToDouble(data["h"]) * scale;

            if (type == 1 && h1 != 25)
            {
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), new Vector2(v1.X, v3.Y - (f - h2) / 2), new Vector2(v1.X + l1, v3.Y - (f - h2) / 2));
                Vector2 v5 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v7 = new Vector2(v5.X, v1.Y - f);
                Vector2 v6 = fun.Inters(new Vector2(v5.X, -f), fun.Polar(v7, 30 * pi / 180, l1), v5, fun.Polar(v5, -30 * pi / 180, l1));
                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v6, v7);
                Vector2 v5_1 = fun.Inters(v1, new Vector2(v1.X, v4.Y - l1), v6, v5);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v7, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v7, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v6, -30, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(v5, new Vector2(v5.X, v5.Y + 0.1)), new Line(v7, new Vector2(v7.X - 0.1, v7.Y)), f / 2.5, height, arrowsize, exline, "90°", "+0°30'", "0");

                //箭头标注
                fun.jt1(dxf, v7, -45, l4 / 2, 0.1, "r", height);

            }

            if (type == 2 && h1 == 25)
            {
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), new Vector2(v1.X, v3.Y - (f - h2) / 2), new Vector2(v1.X + l1, v3.Y - (f - h2) / 2));
                Vector2 v5 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v7 = new Vector2(v5.X, v1.Y - f);
                Vector2 v6 = fun.Inters(new Vector2(v5.X, -f), fun.Polar(v7, 30 * pi / 180, l1), v5, fun.Polar(v5, -30 * pi / 180, l1));
                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v9) * 0.5);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v6, v7);
                Vector2 v5_1 = fun.Inters(v1, new Vector2(v1.X, v4.Y - l1), v6, v5);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v7, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v7, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v6, -30, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(v5, new Vector2(v5.X, v5.Y + 0.1)), new Line(v7, new Vector2(v7.X - 0.1, v7.Y)), f / 2.5, height, arrowsize, exline, "90°", "+0°30'", "0");

                //箭头标注
                fun.jt1(dxf, v7, -45, l4 / 2, 0.1, "r", height);
            }

            if (type == 3)
            {
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v6 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v5 = new Vector2(v6.X, v1.Y - f);
                Vector2 v4_1 = fun.Polar(v5, 10 * pi / 180, l4);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -105 * pi / 180, l1), v4_1, fun.Polar(v4_1, 10 * pi / 180, l1));
                Vector2 v7_1 = fun.Polar(v6, 10 * pi / 180, l4);
                Vector2 v7 = fun.Inters(v1, new Vector2(v1.X, v1.Y - l1), v6, v7_1);

                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v7));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7_1));
                polyline2.Vertexes.Add(new LwPolylineVertex(v4_1));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v5, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v5, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v4_1, -170, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(v5, new Vector2(v5.X, v5.Y + 0.1)), new Line(v5, new Vector2(v5.X - 0.1, v5.Y)), f / 2.5, height, arrowsize, exline, "90°", "+0°30'", "0");
                fun.jdbz2(dxf, new Line(v5, new Vector2(v5.X, v5.Y + 0.1)), new Line(v5, fun.Polar(v5, 10 * pi / 180, 0.1)), f / 2.5, height, arrowsize, exline, "80°", "", "");

            }

            if (type == 4 && h1 != 25)
            {
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), new Vector2(v1.X, v3.Y - (f - h2) / 2), new Vector2(v1.X + l1, v3.Y - (f - h2) / 2));
                Vector2 v5 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v7 = new Vector2(v5.X, v1.Y - f);
                Vector2 v6 = fun.Inters(new Vector2(v5.X, -f), fun.Polar(v7, 30 * pi / 180, l1), v5, fun.Polar(v5, -30 * pi / 180, l1));
                v5 = fun.rotatePoint_Changed(v7, v5, -30);
                v6 = fun.rotatePoint_Changed(v7, v6, -30);
                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v5, v6);
                Vector2 v5_1 = fun.Inters(v1, new Vector2(v1.X, v4.Y - l1), v5, v7);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v7, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v7, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v6, -60, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                /*fun.jdbz2(dxf, new Line(v7, new Vector2(v7.X + 0.1, v7.Y)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, height, arrowsize, exline, "90°", "+0°30'", "0");*/
                fun.jdbz1(dxf, new Line(v7, new Vector2(v7.X + 0.1, v7.Y)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, "90°", height);

                //箭头标注
                fun.jt1(dxf, v7, -45, l4 / 2, 0.1, "r", height);

            }

            if (type == 5 && h1 == 25)
            {
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), new Vector2(v1.X, v3.Y - (f - h2) / 2), new Vector2(v1.X + l1, v3.Y - (f - h2) / 2));
                Vector2 v5 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v7 = new Vector2(v5.X, v1.Y - f);
                Vector2 v6 = fun.Inters(new Vector2(v5.X, -f), fun.Polar(v7, 30 * pi / 180, l1), v5, fun.Polar(v5, -30 * pi / 180, l1));
                v5 = fun.rotatePoint_Changed(v7, v5, -30);
                v6 = fun.rotatePoint_Changed(v7, v6, -30);
                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v9) * 0.5);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v5, v6);
                Vector2 v5_1 = fun.Inters(v1, new Vector2(v1.X, v4.Y - l1), v5, v7);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v7, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v7, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v6, -60, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                /*fun.jdbz2(dxf, new Line(v7, new Vector2(v7.X + 0.1, v7.Y)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, height, arrowsize, exline, "90°", "+0°30'", "0");*/
                fun.jdbz1(dxf, new Line(v7, new Vector2(v7.X + 0.1, v7.Y)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, "90°", height);

                //箭头标注
                fun.jt1(dxf, v7, -45, l4 / 2, 0.1, "r", height);
            }

            if (type == 6)
            {
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v7 = fun.Polar(v1, -105 * pi / 180, f / Math.Cos(10 * pi / 180) - l4);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v6 = new Vector2(v7.X - 2, v7.Y);
                Vector2 v5 = new Vector2(v6.X, v1.Y - f);
                Vector2 v5_1 = fun.Polar(v5, 10 * pi / 180, l4);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), v5_1, fun.Polar(v5_1, 10 * pi / 180, l1));
                Vector2 v7_1 = fun.Polar(v6, 10 * pi / 180, l4);
                v7_1 = fun.rotatePoint_Changed(v5, v7_1, -10);
                v6 = fun.rotatePoint_Changed(v5, v6, -10);
                v5_1 = fun.rotatePoint_Changed(v5, v5_1, -10);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v5_1, v7_1);

                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v7));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7_1));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v5, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v5, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v5_1, 180, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(v5, new Vector2(v5.X + 0.1, v5.Y)), new Line(v5, new Vector2(v5.X, v5.Y - 0.1)), f / 1.5, "90°", height);
                fun.jdbz2(dxf, new Line(v5, new Vector2(v5.X + 0.1, v5.Y)), new Line(v5, fun.Polar(v5, 80 * pi / 180, 0.1)), f / 2.5, height, arrowsize, exline, "80°", "", "");

            }

            if (type == 7 && h1 != 25)
            {
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), new Vector2(v1.X, v3.Y - (f - h2) / 2), new Vector2(v1.X + l1, v3.Y - (f - h2) / 2));
                Vector2 v5 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v7 = new Vector2(v5.X, v1.Y - f);
                Vector2 v6 = fun.Inters(new Vector2(v5.X, -f), fun.Polar(v7, 30 * pi / 180, l1), v5, fun.Polar(v5, -30 * pi / 180, l1));
                v5 = fun.rotatePoint_Changed(v7, v5, -27);
                v6 = fun.rotatePoint_Changed(v7, v6, -27);
                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v5, v6);
                Vector2 v5_1 = fun.Inters(v1, new Vector2(v1.X, v4.Y - l1), v5, v7);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v7, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v7, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v6, -60, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                /*fun.jdbz2(dxf, new Line(v7, new Vector2(v7.X + 0.1, v7.Y)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, height, arrowsize, exline, "90°", "+0°30'", "0");*/
                fun.jdbz1(dxf, new Line(v7, fun.Polar(v7, 3 * pi / 180, 0.1)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, "93°", height);

                //箭头标注
                fun.jt1(dxf, v7, -45, l4 / 2, 0.1, "r", height);

            }

            if (type == 8 && h1 == 25)
            {
                Vector2 v1 = new Vector2(0, 0);
                Vector2 v2 = new Vector2(v1.X + (l1 - l2) * 0.95, v1.Y);
                Vector2 v3 = new Vector2(v2.X, v2.Y - h2);
                Vector2 v4 = fun.Inters(v3, fun.Polar(v3, -135 * pi / 180, l1), new Vector2(v1.X, v3.Y - (f - h2) / 2), new Vector2(v1.X + l1, v3.Y - (f - h2) / 2));
                Vector2 v5 = new Vector2(-((l1 - l2) - (v2.X - v1.X)), -f + l4);
                Vector2 v7 = new Vector2(v5.X, v1.Y - f);
                Vector2 v6 = fun.Inters(new Vector2(v5.X, -f), fun.Polar(v7, 30 * pi / 180, l1), v5, fun.Polar(v5, -30 * pi / 180, l1));
                v5 = fun.rotatePoint_Changed(v7, v5, -27);
                v6 = fun.rotatePoint_Changed(v7, v6, -27);
                Vector2 v8 = new Vector2(v2.X + (l2 - l3), v2.Y);
                Vector2 v9 = new Vector2(v8.X, v3.Y);
                Vector2 v10 = new Vector2(v2.X, v2.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v9) * 0.5);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v4_1 = fun.Inters(v4, new Vector2(v4.X - l1, v4.Y), v5, v6);
                Vector2 v5_1 = fun.Inters(v1, new Vector2(v1.X, v4.Y - l1), v5, v7);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, v3.Y + (v10.Y - v3.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), v2, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(v5_1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v1));
                polyline1.Vertexes.Add(new LwPolylineVertex(v2));
                polyline1.Vertexes.Add(new LwPolylineVertex(v3));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4));
                polyline1.Vertexes.Add(new LwPolylineVertex(v4_1));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                polyline2.Vertexes.Add(new LwPolylineVertex(v6));
                polyline2.Vertexes.Add(new LwPolylineVertex(v7));
                polyline2.Vertexes.Add(new LwPolylineVertex(v5));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(v2));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(v3));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, v3) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, v1, v7, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, v3, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, v7, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, v5, v6, -60, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                /*fun.jdbz2(dxf, new Line(v7, new Vector2(v7.X + 0.1, v7.Y)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, height, arrowsize, exline, "90°", "+0°30'", "0");*/
                fun.jdbz1(dxf, new Line(v7, fun.Polar(v7, 3 * pi / 180, 0.1)), new Line(v7, new Vector2(v7.X, v7.Y - 0.1)), f / 2, "90°", height);

                //箭头标注
                fun.jt1(dxf, v7, -45, l4 / 2, 0.1, "r", height);
            }

            if (type == 9)
            {
                double a = 100;
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 j1 = new Vector2(0, 0);
                Vector2 j2 = fun.Polar(j1, (a + 3) * pi / 180, l4);
                Vector2 j3 = fun.Polar(j1, 3 * pi / 180, l4);
                Vector2 j4 = fun.Polar(j3, (a + 3) * pi / 180, l4);
                Vector2 j5 = fun.Polar(j2, 3 * pi / 180, 1);
                Vector2 j6 = fun.Inters(j5, fun.Polar(j5, (a + 3) * pi / 180, l1), new Vector2(j1.X, j1.Y + f), new Vector2(j1.X + l1, j1.Y + f));
                Vector2 j7 = new Vector2(j1.X + (l1 - l2), j6.Y);
                Vector2 j8 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j2, j4);
                Vector2 j9= fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j3, j4);
                Vector2 j10 = new Vector2(j7.X, j7.Y - h2);
                Vector2 j11 = fun.Inters(j10, fun.Polar(j10, -135 * pi / 180, l1), new Vector2(j1.X, j1.Y + (j10.Y - j1.Y) / 2), new Vector2(j1.X + l1, j1.Y + (j10.Y - j1.Y) / 2));
                Vector2 j12 = fun.Inters(j11, new Vector2(j11.X - l1, j11.Y), j3, j4);

                Vector2 v8 = new Vector2(j7.X + (l2 - l3), j7.Y);
                Vector2 v9 = new Vector2(v8.X, j10.Y);
                Vector2 v10 = new Vector2(j7.X, j7.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, j10.Y + (v10.Y - j10.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), j7, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(j5));
                polyline1.Vertexes.Add(new LwPolylineVertex(j6));
                polyline1.Vertexes.Add(new LwPolylineVertex(j7));
                polyline1.Vertexes.Add(new LwPolylineVertex(j8));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline1_1 = new LwPolyline();
                polyline1_1.Vertexes.Add(new LwPolylineVertex(j9));
                polyline1_1.Vertexes.Add(new LwPolylineVertex(j10));
                polyline1_1.Vertexes.Add(new LwPolylineVertex(j11));
                polyline1_1.Vertexes.Add(new LwPolylineVertex(j12));
                fun.PolyFill(dxf, polyline1_1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                polyline2.Vertexes.Add(new LwPolylineVertex(j2));
                polyline2.Vertexes.Add(new LwPolylineVertex(j4));
                polyline2.Vertexes.Add(new LwPolylineVertex(j3));
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(j7));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(j10));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, j1, j6, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, j10, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, j1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, j1, j3, 180, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X, j1.Y - 0.1)), new Line(j1, fun.Polar(j1, 3 * pi / 180, 0.1)), f / 1.4, "93°", height);
                fun.jdbz2(dxf, new Line(j1, new Vector2(j1.X + 0.1, j1.Y)), new Line(j1, fun.Polar(j1, 55 * pi / 180, 0.1)), f / 2.5, height, arrowsize, exline, "80°", "", "");

            }

            if (type == 10 && h1 != 25)
            {
                double a = 100;
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 j1 = new Vector2(0, 0);
                Vector2 j2 = fun.Polar(j1, (a + 3) * pi / 180, l4);
                Vector2 j3 = fun.Polar(j1, 3 * pi / 180, l4);
                Vector2 j4 = fun.Polar(j3, (a + 3) * pi / 180, l4);
                Vector2 j5 = fun.Polar(j2, 3 * pi / 180, 1);
                Vector2 j6 = fun.Inters(j5, fun.Polar(j5, 90 * pi / 180, l1), new Vector2(j1.X, j1.Y + f), new Vector2(j1.X + l1, j1.Y + f));
                Vector2 j7 = new Vector2(j1.X + (l1 - l2), j6.Y);
                /*Vector2 j8 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j2, j4);
                Vector2 j9 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j3, j4);*/
                Vector2 j10 = new Vector2(j7.X, j7.Y - h2);
                Vector2 j11 = fun.Inters(j10, fun.Polar(j10, -135 * pi / 180, l1), new Vector2(j1.X, j1.Y + (j10.Y - j1.Y) / 2), new Vector2(j1.X + l1, j1.Y + (j10.Y - j1.Y) / 2));
                Vector2 j12 = fun.Inters(j11, new Vector2(j11.X - l1, j11.Y), j3, j4);

                Vector2 v8 = new Vector2(j7.X + (l2 - l3), j7.Y);
                Vector2 v9 = new Vector2(v8.X, j10.Y);
                Vector2 v10 = new Vector2(j7.X, j7.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, j10.Y + (v10.Y - j10.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), j7, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(j5));
                polyline1.Vertexes.Add(new LwPolylineVertex(j6));
                polyline1.Vertexes.Add(new LwPolylineVertex(j7));
                polyline1.Vertexes.Add(new LwPolylineVertex(j10));
                polyline1.Vertexes.Add(new LwPolylineVertex(j11));
                polyline1.Vertexes.Add(new LwPolylineVertex(j12));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                polyline2.Vertexes.Add(new LwPolylineVertex(j2));
                polyline2.Vertexes.Add(new LwPolylineVertex(j4));
                polyline2.Vertexes.Add(new LwPolylineVertex(j3));
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(j7));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(j10));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, j1, j6, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, j10, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, j1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, j1, j2, 180, f * 1.2, 1, height, arrowsize / 2, exline, "a", "", "");
                //右上侧
                fun.dimrot1(dxf, j1, j3, -177, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X, j1.Y - 0.1)), new Line(j1, fun.Polar(j1, 3 * pi / 180, 0.1)), f / 1.4, "93°", height);
                fun.jdbz2(dxf, new Line(j1, fun.Polar(j1, 3 * pi / 180, 0.1)), new Line(j1, fun.Polar(j1, a * pi / 180, 0.1)), f / 2.5, height, arrowsize, exline, "100°", "", "");

            }

            if (type == 11 && h1 != 25)
            {
                double a = 90;
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 j1 = new Vector2(0, 0);
                Vector2 j2 = fun.Polar(j1, (a + 15) * pi / 180, l4);
                Vector2 j3 = fun.Polar(j1, 15 * pi / 180, l4);
                Vector2 j4 = fun.Polar(j3, (a + 15) * pi / 180, l4);
                Vector2 j5 = fun.Polar(j2, 15 * pi / 180, 1);
                Vector2 j6 = fun.Inters(j5, fun.Polar(j5, 90 * pi / 180, l1), new Vector2(j1.X, j1.Y + f), new Vector2(j1.X + l1, j1.Y + f));
                Vector2 j7 = new Vector2(j1.X + (l1 - l2), j6.Y);
                /*Vector2 j8 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j2, j4);
                Vector2 j9 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j3, j4);*/
                Vector2 j10 = new Vector2(j7.X, j7.Y - h2);
                Vector2 j11 = fun.Inters(j10, fun.Polar(j10, -135 * pi / 180, l1), new Vector2(j1.X, j1.Y + (j10.Y - j1.Y) / 2), new Vector2(j1.X + l1, j1.Y + (j10.Y - j1.Y) / 2));
                Vector2 j12 = fun.Inters(j10, new Vector2(j10.X - l1, j10.Y), j3, j4);

                Vector2 v8 = new Vector2(j7.X + (l2 - l3), j7.Y);
                Vector2 v9 = new Vector2(v8.X, j10.Y);
                Vector2 v10 = new Vector2(j7.X, j7.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, j10.Y + (v10.Y - j10.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), j7, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(j5));
                polyline1.Vertexes.Add(new LwPolylineVertex(j6));
                polyline1.Vertexes.Add(new LwPolylineVertex(j7));
                polyline1.Vertexes.Add(new LwPolylineVertex(j10));
                //polyline1.Vertexes.Add(new LwPolylineVertex(j11));
                polyline1.Vertexes.Add(new LwPolylineVertex(j12));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                polyline2.Vertexes.Add(new LwPolylineVertex(j2));
                polyline2.Vertexes.Add(new LwPolylineVertex(j4));
                polyline2.Vertexes.Add(new LwPolylineVertex(j3));
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(j7));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(j10));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, j1, j6, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, j10, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, j1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, j1, j2, 180, f * 1.2, 1, height, arrowsize / 2, exline, "a", "", "");
                //右上侧
                fun.dimrot1(dxf, j1, j3, -165, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X - 0.1, j1.Y)), new Line(j1, fun.Polar(j1, a + 15 * pi / 180, 0.1)), f / 2, "75°±1°", height);
                fun.jdbz2(dxf, new Line(j1, fun.Polar(j1, 15 * pi / 180, 0.1)), new Line(j1, fun.Polar(j1, (a + 15) * pi / 180, 0.1)), f / 2.5, height, arrowsize, exline, "90°", "", "");

            }

            if (type == 12 && h1 == 25)
            {
                /*f = 38;*/
                double a = 90;
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 j1 = new Vector2(0, 0);
                Vector2 j2 = fun.Polar(j1, (a + 15) * pi / 180, l4);
                Vector2 j3 = fun.Polar(j1, 15 * pi / 180, l4);
                Vector2 j4 = fun.Polar(j3, (a + 15) * pi / 180, l4);
                Vector2 j5 = fun.Polar(j2, 15 * pi / 180, 1);
                Vector2 j6 = fun.Inters(j5, fun.Polar(j5, 90 * pi / 180, l1), new Vector2(j1.X, j1.Y + f), new Vector2(j1.X + l1, j1.Y + f));
                Vector2 j7 = new Vector2(j1.X + (l1 - l2), j6.Y);
                /*Vector2 j8 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j2, j4);
                Vector2 j9 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j3, j4);*/
                Vector2 j10 = new Vector2(j7.X, j7.Y - h2);
                Vector2 j11 = fun.Inters(j10, fun.Polar(j10, -135 * pi / 180, l1), new Vector2(j1.X, j1.Y + (j10.Y - j1.Y) / 2), new Vector2(j1.X + l1, j1.Y + (j10.Y - j1.Y) / 2));
                Vector2 j12 = fun.Inters(j10, new Vector2(j10.X - l1, j10.Y), j3, j4);

                Vector2 v8 = new Vector2(j7.X + (l2 - l3), j7.Y);
                Vector2 v9 = new Vector2(v8.X, j10.Y);
                Vector2 v10 = new Vector2(j7.X, j7.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, j10.Y + (v10.Y - j10.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), j7, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(j5));
                polyline1.Vertexes.Add(new LwPolylineVertex(j6));
                polyline1.Vertexes.Add(new LwPolylineVertex(j7));
                polyline1.Vertexes.Add(new LwPolylineVertex(j10));
                //polyline1.Vertexes.Add(new LwPolylineVertex(j11));
                polyline1.Vertexes.Add(new LwPolylineVertex(j12));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                polyline2.Vertexes.Add(new LwPolylineVertex(j2));
                polyline2.Vertexes.Add(new LwPolylineVertex(j4));
                polyline2.Vertexes.Add(new LwPolylineVertex(j3));
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(j7));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(j10));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                fun.dimrot1(dxf, v26, new Vector2(v26.X - 20, v26.Y), 0, f / 2, 1, height, arrowsize, exline, "20±0.13", "", "");
                //左侧
                fun.dimrot1(dxf, j1, j6, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, j10, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, j1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, j1, j2, 180, f * 1.2, 1, height, arrowsize / 2, exline, "a", "", "");
                //右上侧
                fun.dimrot1(dxf, j1, j3, -165, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X - 0.1, j1.Y)), new Line(j1, fun.Polar(j1, a + 15 * pi / 180, 0.1)), f / 2, "75°±1°", height);
                fun.jdbz1(dxf, new Line(j1, fun.Polar(j1, (a + 15) * pi / 180, 0.1)), new Line(j1, fun.Polar(j1, 15 * pi / 180, 0.1)), f / 2.5, "90°", height);

            }

            if (type == 13 && h1 != 25)
            {
                double a = 80;
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 j1 = new Vector2(0, 0);
                Vector2 j2 = fun.Polar(j1, (a + 5) * pi / 180, l4);
                Vector2 j3 = fun.Polar(j1, 5 * pi / 180, l4);
                Vector2 j4 = fun.Polar(j3, (a + 5) * pi / 180, l4);
                Vector2 j5 = fun.Polar(j2, 5 * pi / 180, 1);
                Vector2 j6 = fun.Inters(j5, fun.Polar(j5, (a + 5) * pi / 180, l1), new Vector2(j1.X, j1.Y + f), new Vector2(j1.X + l1, j1.Y + f));
                Vector2 j7 = new Vector2(j1.X + (l1 - l2), j6.Y);
                Vector2 j8 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j2, j4);
                Vector2 j9 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j3, j4);
                Vector2 j10 = new Vector2(j7.X, j7.Y - h2);
                Vector2 j11 = fun.Inters(j10, fun.Polar(j10, -135 * pi / 180, l1), new Vector2(j1.X, j1.Y + (j10.Y - j1.Y) / 2), new Vector2(j1.X + l1, j1.Y + (j10.Y - j1.Y) / 2));
                Vector2 j12 = fun.Inters(j11, new Vector2(j11.X - l1, j11.Y), j3, j4);

                Vector2 v8 = new Vector2(j7.X + (l2 - l3), j7.Y);
                Vector2 v9 = new Vector2(v8.X, j10.Y);
                Vector2 v10 = new Vector2(j7.X, j7.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, j10.Y + (v10.Y - j10.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), j7, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(j5));
                polyline1.Vertexes.Add(new LwPolylineVertex(j6));
                polyline1.Vertexes.Add(new LwPolylineVertex(j7));
                polyline1.Vertexes.Add(new LwPolylineVertex(j10));
                polyline1.Vertexes.Add(new LwPolylineVertex(j11));
                polyline1.Vertexes.Add(new LwPolylineVertex(j12));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                polyline2.Vertexes.Add(new LwPolylineVertex(j2));
                polyline2.Vertexes.Add(new LwPolylineVertex(j4));
                polyline2.Vertexes.Add(new LwPolylineVertex(j3));
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(j7));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(j10));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, j1, j6, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, j10, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, j1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, j1, j3, -175, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X, j1.Y - 0.1)), new Line(j1, fun.Polar(j1, 5 * pi / 180, 0.1)), f / 1.2, "95°", height);
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X - 0.1, j1.Y)), new Line(j1, fun.Polar(j1, (a + 5) * pi / 180, 0.1)), f / 2.1, "95°", height);
                fun.jdbz1(dxf, new Line(j1, fun.Polar(j1, (a + 5) * pi / 180, 0.1)), new Line(j1, fun.Polar(j1, 5 * pi / 180, 0.1)), f / 2.5, "80°", height);

            }

            if (type == 14 && h1 == 25)
            {
                double a = 80;
                //定义点-----------------------------------------------------------------------------------------------------------------------------------
                //第一部分------------------------------------------------------------------------------
                Vector2 j1 = new Vector2(0, 0);
                Vector2 j2 = fun.Polar(j1, (a + 5) * pi / 180, l4);
                Vector2 j3 = fun.Polar(j1, 5 * pi / 180, l4);
                Vector2 j4 = fun.Polar(j3, (a + 5) * pi / 180, l4);
                Vector2 j5 = fun.Polar(j2, 5 * pi / 180, 1);
                Vector2 j6 = fun.Inters(j5, fun.Polar(j5, (a + 5) * pi / 180, l1), new Vector2(j1.X, j1.Y + f), new Vector2(j1.X + l1, j1.Y + f));
                Vector2 j7 = new Vector2(j1.X + (l1 - l2), j6.Y);
                Vector2 j8 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j2, j4);
                Vector2 j9 = fun.Inters(j7, new Vector2(j7.X, j7.Y - l1), j3, j4);
                Vector2 j10 = new Vector2(j7.X, j7.Y - h2);
                Vector2 j11 = fun.Inters(j10, fun.Polar(j10, -135 * pi / 180, l1), new Vector2(j1.X, j1.Y + (j10.Y - j1.Y) / 2), new Vector2(j1.X + l1, j1.Y + (j10.Y - j1.Y) / 2));
                Vector2 j12 = fun.Inters(j11, new Vector2(j11.X - l1, j11.Y), j3, j4);

                Vector2 v8 = new Vector2(j7.X + (l2 - l3), j7.Y);
                Vector2 v9 = new Vector2(v8.X, j10.Y);
                Vector2 v10 = new Vector2(j7.X, j7.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, j10.Y + (v10.Y - j10.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), j7, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(j5));
                polyline1.Vertexes.Add(new LwPolylineVertex(j6));
                polyline1.Vertexes.Add(new LwPolylineVertex(j7));
                polyline1.Vertexes.Add(new LwPolylineVertex(j10));
                polyline1.Vertexes.Add(new LwPolylineVertex(j11));
                polyline1.Vertexes.Add(new LwPolylineVertex(j12));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                polyline2.Vertexes.Add(new LwPolylineVertex(j2));
                polyline2.Vertexes.Add(new LwPolylineVertex(j4));
                polyline2.Vertexes.Add(new LwPolylineVertex(j3));
                polyline2.Vertexes.Add(new LwPolylineVertex(j1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(j7));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(j10));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, j10) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                fun.dimrot1(dxf, v26, new Vector2(v26.X - 20, v26.Y), 0, f / 2, 1, height, arrowsize, exline, "20±0.13", "", "");
                //左侧
                fun.dimrot1(dxf, j1, j6, 90, l3 * 2, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, j10, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, j1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, j1, j3, -175, f / 3, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X, j1.Y - 0.1)), new Line(j1, fun.Polar(j1, 5 * pi / 180, 0.1)), f / 1.2, "95°", height);
                fun.jdbz1(dxf, new Line(j1, new Vector2(j1.X - 0.1, j1.Y)), new Line(j1, fun.Polar(j1, (a + 5) * pi / 180, 0.1)), f / 2.1, "95°", height);
                fun.jdbz1(dxf, new Line(j1, fun.Polar(j1, (a + 5) * pi / 180, 0.1)), new Line(j1, fun.Polar(j1, 5 * pi / 180, 0.1)), f / 2.5, "80°", height);

            }

            if (type == 15 && h1 != 25)//S型三角形
            {
                //l4 = 5.6;
                double a = Convert.ToDouble(data["a"]) * scale;
                /*b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 135 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 15 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 15 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 45 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 15, f , 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 135 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "45°±1°", "", "");

            }

            if (type == 16)//S型菱形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 135 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 35 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s3, -45 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 35 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1, 35 * pi / 180, l1), s3, fun.Polar(s3, -45 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                /*Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);*/

                Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 45, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 135 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "45°±1°", "", "");

            }

            if (type == 17)//S型方形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 135 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 45 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s3, -45 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 35 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1, 45 * pi / 180, l1), s3, fun.Polar(s3, -45 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                /*Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);*/

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 45, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 135 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "45°±1°", "", "");

            }

            if (type == 18)//T型菱形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 150 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 50 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s3, -30 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 35 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1, 50 * pi / 180, l1), s3, fun.Polar(s3, -30 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                /*Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);*/

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 45, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s2, new Vector2(s2.X, s1.Y - 0.1)), new Line(s2, fun.Polar(s2, -30 * pi / 180, 0.1)), f / 1.2, height, arrowsize, exline, "60°±1°", "", "");
                fun.jdbz2(dxf, new Line(s2, fun.Polar(s2, -30 * pi / 180, 0.1)), new Line(s2, fun.Polar(s2, 50 * pi / 180, 0.1)), f / 2, height, arrowsize, exline, "80°", "", "");

            }

            if (type == 19 && h1 != 25)//T型三角形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 150 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 30 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 30 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 45 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 15, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s2, new Vector2(s2.X, s1.Y - 0.1)), new Line(s2, fun.Polar(s2, -30 * pi / 180, 0.1)), f / 1.2, height, arrowsize, exline, "60°±1°", "", "");

            }

            if (type == 20 && h1 == 25)//T型三角形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                /*l4 = 27.5;
                double a = 12.2;
                b = 25;
                d1 = 100;
                d2 = 11;
                e = 30;
                f = 20;
                h2 = 35;
                l1 = 100;
                l2 = 59;
                l3 = 10;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 150 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 30 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 30 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f + a), new Vector2(s1.X - l1, s1.Y + f + a));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s2, 90, l3 * 3, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 30, f * 1.2, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s2, new Vector2(s2.X, s1.Y - 0.1)), new Line(s2, fun.Polar(s2, -30 * pi / 180, 0.1)), f / 1.4, height, arrowsize, exline, "60°±1°", "", "");

            }

            if (type == 21 && h1 != 25)//U型三角形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 87 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, -33 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, -33 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, -27, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 87 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "93°±1°", "", "");

            }

            if (type == 22 && h1 == 25)//U型三角形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //l4 = 27.5;
                //double a = 12.2;
                /*b = 25;
                d1 = 100;
                d2 = 11;
                e = 30;
                f = 20;
                h2 = 35;
                l1 = 100;
                l2 = 59;
                l3 = 10;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 87 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, -33 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, -33 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, -27, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 87 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "93°±1°", "", "");

            }

            if (type == 23)//W型菱形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //double a = 2.6;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 120 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 20 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 20 * pi / 180, l4);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 20 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s4, fun.Polar(s4, 20 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.8));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1, 20 * pi / 180, l1), s3, fun.Polar(s3, -60 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                /*Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);*/

                Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 30, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 120 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "60°±1°", "", "");
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 20 * pi / 180, 0.1)), new Line(s1, fun.Polar(s1, 120 * pi / 180, 0.1)), f / 2, height, arrowsize, exline, "100°", "", "");

            }

            if (type == 24 && h1 != 25)//W型三角形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //l4 = 27.5;
                //double a = 2.6;
                /*b = 25;
                d1 = 100;
                d2 = 11;
                e = 30;
                f = 20;
                h2 = 35;
                l1 = 100;
                l2 = 59;
                l3 = 10;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 120 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 0 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 0 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s1, s2, 180, f * 1.5, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 0, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 120 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "60°±1°", "", "");

            }

            if (type == 25 && h1 == 25)//W型三角形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //l4 = 27.5;
                //double a = 12.7;
                /*b = 25;
                d1 = 100;
                d2 = 11;
                e = 30;
                f = 20;
                h2 = 35;
                l1 = 100;
                l2 = 59;
                l3 = 10;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 120 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 0 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 0 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s3);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s1, s2, 180, f * 1.5, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 0, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 120 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "60°±1°", "", "");

            }

            if (type == 26)//Y型菱形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //double a = 2.6;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 95 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 15 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 15 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.8));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1,15 * pi / 180, l1), s3, fun.Polar(s3, -85 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s1, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                /*Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);*/

                Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 30, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 95 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "85°±1°", "", "");
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 15 * pi / 180, 0.1)), new Line(s1, fun.Polar(s1, 95 * pi / 180, 0.1)), f / 2, height, arrowsize, exline, "80°", "", "");

            }

            if (type == 27 && h1 != 25)//Y型方形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //double a = 2.6;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 95 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 5 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 5 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1, 5 * pi / 180, l1), s3, fun.Polar(s3, -85 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s3, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                /*Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);*/

                Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 5, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 95 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "85°±1°", "", "");

            }

            if (type == 28 && h1 == 25)//Y型方形
            {
                double a = Convert.ToDouble(data["a"]) * scale;
                //double a = 12.7;
                /*l4 = 5.6;
                double a = 3.7;
                b = 6;
                d1 = 20;
                d2 = 4;
                e = 12;
                f = 8;
                h2 = 8.5;
                l1 = 21;
                l2 = 16;
                l3 = 3.5;
                t = 3.5;*/

                Vector2 s1 = new Vector2(0, 0);
                Vector2 s2 = fun.Polar(s1, 95 * pi / 180, l4);
                Vector2 s3 = fun.Polar(s2, 5 * pi / 180, l4);
                Vector2 s4 = fun.Polar(s2, 5 * pi / 180, l4 / 10);
                Vector2 s5 = fun.Inters(s4, fun.Polar(s4, 90 * pi / 180, f), new Vector2(s1.X + l1, s1.Y + f), new Vector2(s1.X - l1, s1.Y + f));
                Vector2 s6 = fun.Inters(s5, new Vector2(s5.X + l1, s5.Y), new Vector2(s1.X + (l1 - l2), s1.Y), new Vector2(s1.X + (l1 - l2), s1.Y + l1));
                Vector2 s7 = new Vector2(s6.X, s6.Y - h2);
                Vector2 s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y - Math.Abs(s7.Y * 0.5));
                if (h2 > f)
                {
                    s8 = new Vector2(s7.X - Math.Abs(s7.X * 0.2), s7.Y + Math.Abs(s7.Y * 1.5));
                }
                Vector2 s14 = fun.Inters(s1, fun.Polar(s1, 5 * pi / 180, l1), s3, fun.Polar(s3, -85 * pi / 180, l1));
                Vector2 s9 = fun.Inters(s8, new Vector2(s8.X - l1, s8.Y), s3, s14);

                Vector2 v8 = new Vector2(s6.X + (l2 - l3), s6.Y);
                Vector2 v9 = new Vector2(v8.X, s7.Y);
                Vector2 v10 = new Vector2(s6.X, s6.Y - h2 * 0.6);
                Vector2 v11 = new Vector2(v10.X + (l2 - l3), v10.Y);
                Vector2 v12 = new Vector2(v8.X - 1, v8.Y - fun.CalDistance(v8, v11) * 0.7);
                Vector2 v13 = new Vector2(v12.X + l3 * 1.2, v12.Y);
                Vector2 v14 = new Vector2(v8.X, v8.Y - fun.CalDistance(v8, v11) * 0.2);
                Vector2 v15 = new Vector2(v14.X + l3 * 0.4, v14.Y);
                Vector2 v16 = new Vector2(v15.X, v15.Y + fun.CalDistance(v8, v14) / 2);
                Vector2 v17 = fun.Inters(v16, fun.Polar(v16, 45 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v19 = new Vector2(v8.X + l3, v16.Y);
                Vector2 v18 = fun.Inters(v19, fun.Polar(v19, 135 * pi / 180, l1), v8, new Vector2(v8.X + l1, v8.Y));
                Vector2 v20 = fun.mirrorpoint(v19, v12, v13);
                Vector2 v21 = fun.mirrorpoint(v18, v12, v13);
                Vector2 v22 = fun.mirrorpoint(v17, v12, v13);
                Vector2 v23 = fun.mirrorpoint(v16, v12, v13);
                Vector2 v24 = fun.mirrorpoint(v15, v12, v13);
                Vector2 v25 = fun.mirrorpoint(v14, v12, v13);
                Vector2 v26 = new Vector2(v19.X - e, v19.Y + 1);
                Vector2 v27 = new Vector2(v26.X, v9.Y - 1);
                Vector2 v28 = new Vector2(v10.X + (v26.X - v10.X) / 2, s7.Y + (v10.Y - s7.Y) / 2);
                Vector2 v29 = fun.mirrorpoint(v28, v26, v27);
                Vector2 v30 = new Vector2(v26.X, v28.Y);
                Vector2 v31 = new Vector2(v30.X - l3 * 0.4, v30.Y);
                Vector2 v32 = fun.Inters(v31, new Vector2(v31.X, v31.Y + l1), s6, v8);
                Vector2 v33 = fun.mirrorpoint(v31, v26, v27);
                Vector2 v34 = fun.mirrorpoint(v32, v26, v27);

                Vector2 s10 = new Vector2(v14.X, v14.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s11 = new Vector2(v15.X, v15.Y - Math.Abs((v14.Y - v12.Y) / 4.0));
                Vector2 s12 = fun.mirrorpoint(s11, v12, v13);
                Vector2 s13 = fun.mirrorpoint(s10, v12, v13);

                //作图部分-------------------------------------------------------------------------------------------------
                //轮廓线
                LwPolyline polyline1 = new LwPolyline();
                polyline1.Vertexes.Add(new LwPolylineVertex(s4));
                polyline1.Vertexes.Add(new LwPolylineVertex(s5));
                polyline1.Vertexes.Add(new LwPolylineVertex(s6));
                polyline1.Vertexes.Add(new LwPolylineVertex(s7));
                polyline1.Vertexes.Add(new LwPolylineVertex(s8));
                polyline1.Vertexes.Add(new LwPolylineVertex(s9));
                fun.PolyFill(dxf, polyline1, 0.3, contour);

                LwPolyline polyline2 = new LwPolyline();
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                polyline2.Vertexes.Add(new LwPolylineVertex(s2));
                polyline2.Vertexes.Add(new LwPolylineVertex(s3));
                polyline2.Vertexes.Add(new LwPolylineVertex(s14));
                polyline2.Vertexes.Add(new LwPolylineVertex(s1));
                fun.PolyFill(dxf, polyline2, 0.3, contour);

                LwPolyline polyline3 = new LwPolyline();
                polyline3.Vertexes.Add(new LwPolylineVertex(s6));
                polyline3.Vertexes.Add(new LwPolylineVertex(v8));
                polyline3.Vertexes.Add(new LwPolylineVertex(v14));
                polyline3.Vertexes.Add(new LwPolylineVertex(v15));
                polyline3.Vertexes.Add(new LwPolylineVertex(v16));
                polyline3.Vertexes.Add(new LwPolylineVertex(v17));
                polyline3.Vertexes.Add(new LwPolylineVertex(v18));
                polyline3.Vertexes.Add(new LwPolylineVertex(v19));
                polyline3.Vertexes.Add(new LwPolylineVertex(v20));
                polyline3.Vertexes.Add(new LwPolylineVertex(v21));
                polyline3.Vertexes.Add(new LwPolylineVertex(v22));
                polyline3.Vertexes.Add(new LwPolylineVertex(v23));
                polyline3.Vertexes.Add(new LwPolylineVertex(v24));
                polyline3.Vertexes.Add(new LwPolylineVertex(v25));
                polyline3.Vertexes.Add(new LwPolylineVertex(v9));
                polyline3.Vertexes.Add(new LwPolylineVertex(s7));
                fun.PolyFill(dxf, polyline3, 0.3, contour);

                LwPolyline polyline4 = new LwPolyline();
                polyline4.Vertexes.Add(new LwPolylineVertex(v10));
                polyline4.Vertexes.Add(new LwPolylineVertex(v11));
                fun.PolyFill(dxf, polyline4, 0.3, contour);

                LwPolyline polyline5 = new LwPolyline();
                polyline5.Vertexes.Add(new LwPolylineVertex(v15));
                polyline5.Vertexes.Add(new LwPolylineVertex(v24));
                fun.PolyFill(dxf, polyline5, 0.3, contour);

                LwPolyline polyline6 = new LwPolyline();
                polyline6.Vertexes.Add(new LwPolylineVertex(v17));
                polyline6.Vertexes.Add(new LwPolylineVertex(v22));
                fun.PolyFill(dxf, polyline6, 0.3, contour);

                LwPolyline polyline7 = new LwPolyline();
                polyline7.Vertexes.Add(new LwPolylineVertex(v18));
                polyline7.Vertexes.Add(new LwPolylineVertex(v21));
                fun.PolyFill(dxf, polyline7, 0.3, contour);

                LwPolyline polyline8 = new LwPolyline();
                polyline8.Vertexes.Add(new LwPolylineVertex(v14));
                polyline8.Vertexes.Add(new LwPolylineVertex(v25));
                fun.PolyFill(dxf, polyline8, 0.3, contour);

                Line line1 = new Line(v26, v27);
                line1.Layer = centre;
                line1.Linetype = Linetype.Center;
                line1.LinetypeScale = 1;
                dxf.AddEntity(line1);

                Line line2 = new Line(v32, v31);
                line2.Layer = refin;
                line2.Linetype = Linetype.Dashed;
                line2.LinetypeScale = 1;
                dxf.AddEntity(line2);

                Line line3 = new Line(v34, v33);
                line3.Layer = refin;
                line3.Linetype = Linetype.Dashed;
                line3.LinetypeScale = 1;
                dxf.AddEntity(line3);

                Line line4 = new Line(v31, v33);
                line4.Layer = centre;
                line4.Linetype = Linetype.Center;
                line4.LinetypeScale = 1;
                dxf.AddEntity(line4);

                /*Ellipse ellipse1 = new Ellipse(v30, fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse1.Layer = contour;
                dxf.AddEntity(ellipse1);*/

                Ellipse ellipse1 = new Ellipse
                {
                    Center = new Vector3(v30.X, v30.Y, 0),
                    MajorAxis = fun.CalDistance(v31, v33),
                    MinorAxis = fun.CalDistance(v10, s7) / 2,
                    StartAngle = 0,
                    EndAngle = 360,
                };
                dxf.AddEntity(ellipse1);

                Ellipse ellipse2 = new Ellipse(new Vector2(v30.X - 20, v30.Y), fun.CalDistance(v31, v33), fun.CalDistance(v10, s7) / 2);
                ellipse2.Layer = contour;
                dxf.AddEntity(ellipse2);

                Line line5 = new Line(new Vector2(v26.X - 20, v26.Y), new Vector2(v27.X - 20, v27.Y));
                line5.Layer = centre;
                line5.Linetype = Linetype.Center;
                line5.LinetypeScale = 1;
                dxf.AddEntity(line5);

                Line line6 = new Line(new Vector2(v32.X - 20, v32.Y), new Vector2(v31.X - 20, v31.Y));
                line6.Layer = refin;
                line6.Linetype = Linetype.Dashed;
                line6.LinetypeScale = 1;
                dxf.AddEntity(line6);

                Line line7 = new Line(new Vector2(v34.X - 20, v34.Y), new Vector2(v33.X - 20, v33.Y));
                line7.Layer = refin;
                line7.Linetype = Linetype.Dashed;
                line7.LinetypeScale = 1;
                dxf.AddEntity(line7);

                Line line8 = new Line(new Vector2(v31.X - 20, v31.Y), new Vector2(v33.X - 20, v33.Y));
                line8.Layer = centre;
                line8.Linetype = Linetype.Center;
                line8.LinetypeScale = 1;
                dxf.AddEntity(line8);

                //螺纹线
                LwPolyline polyline9 = new LwPolyline();
                polyline9.Vertexes.Add(new LwPolylineVertex(s10));
                polyline9.Vertexes.Add(new LwPolylineVertex(s11));
                fun.PolyFill(dxf, polyline9, 0.1, contour);

                LwPolyline polyline10 = new LwPolyline();
                polyline10.Vertexes.Add(new LwPolylineVertex(s12));
                polyline10.Vertexes.Add(new LwPolylineVertex(s13));
                fun.PolyFill(dxf, polyline10, 0.1, contour);

                //标注------------------------------------------------------------------------------------------
                //定义
                double height = 1;
                double arrowsize = 1;
                double exline = 1;

                //第一部分---------------------------------------------------
                //直线标注
                //上侧
                fun.dimrot1(dxf, v26, v19, 0, f / 2, 1, height, arrowsize, exline, "e=" + Math.Round(e, 1), "", "");
                //左侧
                fun.dimrot1(dxf, s5, s1, 90, l3 * 3.5, 1, height, arrowsize, exline, "f=" + Math.Round(f, 1), "", "");
                //下侧
                fun.dimrot1(dxf, s7, v20, 180, f, 1, height, arrowsize, exline, "l2=" + Math.Round(l2, 1), "", "");
                fun.dimrot1(dxf, v9, v20, 180, f / 2, 1, height, arrowsize, exline, "l3=" + Math.Round(l3, 1), "", "");
                fun.dimrot1(dxf, s1, v20, 180, f * 1.5, 1, height, arrowsize, exline, "l1=" + Math.Round(l1, 1), "", "");
                fun.dimrot1(dxf, s2, s1, 180, f * 1.7, 1, height, arrowsize, exline, "a=" + Math.Round(a, 1), "", "");
                //右上侧
                fun.dimrot1(dxf, s2, s3, 5, f, 1, height, arrowsize, exline, "l4=" + Math.Round(l4, 1), "", "");

                //角度标注
                fun.jdbz2(dxf, new Line(s1, fun.Polar(s1, 95 * pi / 180, 0.1)), new Line(s1, new Vector2(s1.X - 0.1, s1.Y)), f / 1.2, height, arrowsize, exline, "85°±1°", "", "");

            }

            double isframe = Convert.ToInt32(data["isframe"]);
            String isframe_chose = Convert.ToString(data["isframe_chose"]);
            Vector2 p0 = new Vector2(0, 0);
            if (isframe == 1)
            {
                if (isframe_chose.Equals("0"))
                {
                    Dictionary<string, Vector2> position = Frame.frameA0X(dxf, new Vector2(p0.X - 1189 / 2.0, p0.Y + 841 / 2.0), data);
                    fun.writetext(dxf, scale + ":1", position["比例"], 3.5, 0, 0.6, "C");
                }

                if (isframe_chose.Equals("1"))
                {
                    Dictionary<string, Vector2> position = Frame.frameA1X(dxf, new Vector2(p0.X - 841 / 2.0, p0.Y + 594 / 2.0), data);
                    fun.writetext(dxf, scale + ":1", position["比例"], 3.5, 0, 0.6, "C");
                }

                if (isframe_chose.Equals("2"))
                {
                    Dictionary<string, Vector2> position = Frame.frameA2X(dxf, new Vector2(p0.X - 594 / 2.0, p0.Y + 420 / 2.0), data);
                    fun.writetext(dxf, scale + ":1", position["比例"], 3.5, 0, 0.6, "C");
                }

                if (isframe_chose.Equals("3"))
                {
                    Dictionary<string, Vector2> position = Frame.frameA3X(dxf, new Vector2(p0.X - 420 / 2.0, p0.Y + 297 / 2.0), data);
                    fun.writetext(dxf, scale + ":1", position["比例"], 3.5, 0, 0.6, "C");
                }

                if (isframe_chose.Equals("4X"))
                {
                    Dictionary<string, Vector2> position = Frame.frameA4X(dxf, new Vector2(p0.X - 297 / 2.0, p0.Y + 210 / 2.0 - 10 * 2.26), data);
                    fun.writetext(dxf, scale + ":1", position["比例"], 3.5, 0, 0.6, "C");
                }

                if (isframe_chose.Equals("4Y"))
                {
                    Dictionary<string, Vector2> position = Frame.frameA4Y(dxf, new Vector2(p0.X - 210 / 2.0, p0.Y + 297 / 2.0), data);
                    fun.writetext(dxf, scale + ":1", position["比例"], 3.5, 0, 0.6, "C");
                }
            }



            //定义格式，根据路径导出
            dxf.DrawingVariables.AcadVer = DxfVersion.AutoCad2007;
            dxf.Save(path);
        }
    }
}
